1. Field of the Invention
The invention relates to network devices, and in particular, to a method and apparatus for individually programming the most significant bit of a VLAN identifier.
2. Description of the Related Art
A LAN may be configured into multiple logical LANs or Virtual LANs (VLAN) to allow network operators to configure and administer networks as a single entity, while providing users with the connectivity and privacy of multiple separate networks. Further to this objective, the IEEE 802.1Q VLAN standard was created to break larger networks into smaller networks so that network traffic would not capture more bandwidth than necessary. All traffic on a VLAN is sent only to users of that VLAN. Therefore, users not belonging to the VLAN cannot send or receive any traffic to or from users on the VLAN.
To support IEEE 802.1Q VLAN, a current configuration of an Ethernet switch uses a 4,096 entry Address Resolution Table (ARL) and a VLAN table. The ARL table enables the switch to find the destination port(s) for incoming frames. Each ARL entry stores a frame's VLAN ID (VID) in registers (11:0), a frame's MAC address in registers (47:0) and an action code which tells the switch which port(s) to send the frame to in registers (m:0), where m is the size of the action code. The VLAN table is used to store VLAN related information for frame forwarding. Specifically, each VLAN entry stores a VLAN forward map in registers (n:0) and a VLAN un-tag map in registers (n:0), where n is the number of switch ports. The maximum size of each VID is 12 bit and the maximum number of VIDs in the ARL table is 4,096. To support all of the VIDs in the ARL table, the VLAN table also has 4096 entries. The switch uses each VID to access the appropriate entry in the VLAN table.
Upon receiving an incoming frame, the switch obtains the MAC destination address in registers (47:0) and the VID in registers (11:0) from the incoming frame. The incoming frame's MAC destination address in registers (47:0) and the VID in registers (11:0) are hashed to a 12 bit ARL address which is used to access the ARL table. Upon obtaining the appropriate entry in the ARL table, the switch compares the VID in registers (11:0) and MAC address in registers (47:0) in the ARL table with the incoming frame's VID in registers (11:0) and MAC destination address (47:0). If they are the same, then there is an ARL hit and the action code in the ARL table is used to determine which egress port(s) to send the incoming frame to. The incoming frame's VID in registers (11:0) is also used to access the VLAN table and the switch reads the forward map and the un-tag map from the VLAN entry that is associated with the VID. If there was an ARL hit and the ports indicated by the action code in the ARL table are also active in the forward map, then the switch forwards the incoming frame to the identified egress port(s). If there was not a hit in the ARL table, but there was a match in the VLAN table, the switch uses the forward map in the VLAN table to forward the incoming frame to the appropriate destination port(s). If the was not a match in either the VLAN or ARL tables, the switch drops the frame.
It takes a lot of silicon area to accommodate a 4,096 entry VLAN table. Moreover, most systems do not use all of the VID. Therefore, a current configuration uses an ARL table wherein the VID in registers (11:4) is fixed and predefined. In this configuration, the VLAN table includes 16 entries. The less significant bits of the VID, i.e. registers (3:0), are used to index the VLAN table and the most significant bits of the VID are predefined among the switch users and fixed. The drawback to this implementation is that the VID has to be in a continuous VLAN space. For some existing environments, this is difficult to implement.